<template>
    <div class="reminder" :style="winSize">
        <el-row>
            <el-col :span='24'>
                <div class="content">
                    <el-form label-position="left" label-width="55px" class="demo-ruleForm card-box loginform"
                             v-loading="submit_actions.disabled"
                             :element-loading-text="'正在提交...'"
                             :style="formOffset"
                             :model='data'
                             :rules="rule_data"
                             ref='data'
                             v-if='firstStep'>
                        <h3 class="title">
                            <span class="active">找回密码</span>
                        </h3>
                        <el-form-item  v-show='firstStep'
                                label='手机号'
                                prop='phone'>
                            <el-input type="text" auto-complete="off" placeholder="请输入绑定的手机号"
                                      v-model='data.phone'
                                      @change='handleChange'></el-input>
                        </el-form-item>

                        <el-form-item  v-show='firstStep'
                                label='验证码'
                                prop='code'>
                            <el-input type="text" auto-complete="off" placeholder="请输入验证码"
                                      class='code'
                                      v-model='data.code'
                                      @keyup.native.enter="onValidate('data')"></el-input><send-code :phone='data.phone' ref='code' :type='1' style='margin-left:5px;'></send-code>
                        </el-form-item>

                        <el-form-item class='assist-group'  v-show='firstStep'>
                            <el-button type='text' class='btn btn-back' @click='onBackToLogin'>返回登录</el-button>
                        </el-form-item>
                        <el-button type="primary"
                                   size='large'
                                   class='btn-sub'
                                   @click='onValidate("data")'>下一步
                        </el-button>
                    </el-form>
                    <el-form label-position="left" label-width="55px" class="demo-ruleForm card-box loginform"
                             v-loading="submit_actions.disabled"
                             :element-loading-text="'正在提交...'"
                             :style="formOffset"
                             :model='data'
                             :rules="rule_data"
                             ref='data'
                             v-else>
                        <h3 class="title">
                            <span class="active">找回密码</span>
                        </h3>
                        <el-form-item label='新密码'
                                prop='password'>
                            <el-input type="password" auto-complete="off" placeholder="请输入新密码"
                                      v-model='data.password'
                                      @keyup.native.enter="onModify('data')"></el-input>
                        </el-form-item>
                        <el-button type="primary"
                                   size='large'
                                   class='btn-sub'
                                   @click='onModify("data")'>完成
                        </el-button>
                    </el-form>
                </div>
            </el-col>
        </el-row>
    </div>
</template>

<script>
	import ReminderJS from './Reminder.js';
	module.exports = ReminderJS;
</script>

<style scoped lang='less'>
    @import url(Reminder.less);
</style>
